<?php
if (isset($_POST['submit'])) {
	$qty = $_POST['qty'];
	$arrProducts = array(
			array(
				"product_id" => "$id",
				"qty" => $qty
			)
		);
	try {
		$cid = $_SESSION['cid'];
		$resultCartProductAdd = $soap->call($session_id, "cart_product.add", array($cid, $arrProducts));
	} catch (Exception $e) {
		$cid = $soap->call ($session_id, 'cart.create');
		$_SESSION['cid'] = $cid;
		$resultCartProductAdd = $soap->call($session_id, "cart_product.add", array($cid, $arrProducts));
	}
	header("location: cart.php");
}
?>